function verify(btn) {
	var form = $($(btn).parents(".form").parent().children(".form")[0]);
	var data = getData(form);
	if (data && data.newPassword && data.newPassword
			&& data.newPassword == data.verify) {
		return true;
	} else {
		layer.msg("不能提交，请检查是否还有字段没有输入，且保证两次新密码输入一致。", {
			shift : 6,
			offset : "5%"
		});
		return false;
	}
}
$(function() {
	var closed = false;
	$("#modify-password").click(function() {
		_editerIndex = layer.open({
			title : "修改密码",
			type : 1,
			skin : 'layui-layer-rim',
			area : [ "360px", "250px" ],
			content : '<div id="customer-editer" class="form" style="height: 100%;overflow: auto;">'
					+ '<input type="hidden" name="submit-url" value="admin/modifyPassword.do" />'
					+ '<label class="from-label" for="password">旧密码：</label>'
					+ '<input type="password" allowBlank="false" name="password" class="form-control" placeholder="旧密码" />'
					+ '<label class="from-label" for="newPassword">新密码：</label>'
					+ '<input type="password" allowBlank="false" name="newPassword" class="form-control" placeholder="新密码" />'
					+ '<label class="from-label" for="verify">确认新密码：</label>'
					+ '<input type="password" allowBlank="false" name="verify" class="form-control" placeholder="确认新密码" />'
					+ '<br><br><br>'
					+ '</div>'
					+ '<div class="form" style="position: absolute;bottom: 0px;width: 100%;text-align: right;background-color: #DDD;">'
					+ '<input type="button" class="btn btn-sm btn-success" onclick="if(verify(this)){submitEditer(this);}" value="保存"/>'
					+ '<input type="button" class="btn btn-sm btn-info" onclick="closeEditer(this)" value="返回"/>'
					+ '</div>'
				});
			});
	$("#exit").click(function() {
		if (closed) {
			return true;
		}
		var btn = this;
		layer.confirm("确定退出当前管理员账户？", {
			icon : 3,
			title : "操作提示",
			closeBtn : false,
			skin : "layui-layer-red",
			btn : [ "确定", "取消" ]
		}, function() {
			closed = true;
			btn.click();
		});
		return false;
	});
});